package com.roger.cmdkit.demo;

public class PersonEntity {

    String name;
    private int age;

    PersonEntity(){
        super();
    }

    PersonEntity(String name, int age)throws DataErrorException {
        super();
        this.name=name;
        this.age=age;
        if(name.length()>8||age<0){
            throw new DataErrorException(this.name,this.age);
        }
    }

    String getName(){ return this.name; }

    Integer getAge(){ return this.age; }

    void setName(String name){ this.name=name; }

    void setAge(int age){ this.age=age; }
}
